<?php

//use Illuminate\Http\Request;

/*
|--------------------------------------------------------------------------
| API Routes
|--------------------------------------------------------------------------
|
| Here is where you can register API routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| is assigned the "api" middleware group. Enjoy building your API!
|
*/

//Route::middleware('auth:api')->get('/user', function (Request $request) {
//    return $request->user();
//});
//注册登录
Route::get('/shop/index', 'Console\ShopController@index');
Route::post('/login/store', 'Console\LoginController@store');
Route::post('/login/register', 'Console\LoginController@register');
//阿里云验证码
Route::post('/login/send', 'Console\LoginController@send');
//用户找回密码
Route::post('/login/findpass', 'Console\LoginController@findpass');

//图片上传七牛云
Route::post('/qiniu/uploads', 'Console\QiniuController@uploads');

//生成个人邀请码图片
Route::post('/login/qrcode', 'Console\LoginController@qrcode');

//登录验证token
Route::group(['middleware' => 'token'], function() {
    Route::post('/shop/store', 'Console\ShopController@store');
});
//管理员管理

//极光推送给指定的人员推送通知
Route::post('/jpush/index', 'Console\JpushController@jpush_app');

//车主认证
Route::post('/carowner/chezhu', 'Console\CarownerController@chezhu');

//车辆认证
Route::post('/carowner/cheliang', 'Console\CarownerController@cheliang');

//个人中心邀请码
Route::post('/login/qrcode', 'Console\LoginController@qrcode');


//登录验证token
Route::group(['middleware' => 'token'], function() {
    Route::post('/shop/index', 'Console\ShopController@index');
    Route::post('/admin/register', 'Admin\AdminController@register');//管理员注册/编辑
    Route::post('/qiniu/uploads', 'Console\QiniuController@uploads');
});

Route::post('/shop/create', 'Console\ShopController@create');


Route::post('/admin/login', 'Admin\AdminController@login');//管理员登录
Route::post('/admin/register', 'Admin\AdminController@register');//管理员注册和编辑
Route::get('/admin/get_admin', 'Admin\AdminController@get_admin');//获取管理员(含搜索、列表、详情）
Route::post('/admin/is_use', 'Admin\AdminController@is_use');//启用禁用管理员
Route::post('/admin/login_out', 'Admin\AdminController@login_out');//管理员退出
Route::post('/admin/del_role', 'Admin\AdminController@del_role');//删除角色
Route::post('/admin/act_role', 'Admin\AdminController@addedit_role');//添加编辑角色
Route::get('/admin/get_role', 'Admin\AdminController@get_role');//获取角色
//菜单管理
Route::post('/menus/act_menus', 'Admin\MenusController@act_menus');//添加编辑菜单/按钮
Route::get('/menus/get_menus', 'Admin\MenusController@get_menus');//获取菜单列表
Route::get('/menus/get_all_menus', 'Admin\MenusController@get_all_menus');//获取所有菜单和按钮（分配权限时使用）
Route::get('/menus/menus_details', 'Admin\MenusController@menus_details');//获取菜单或按钮详情
Route::post('/menus/del_menus', 'Admin\MenusController@del_menus');//删除菜单


//管理员管理
Route::post('/console/login', 'Console\AdminController@login');//管理员登录
Route::post('/console/register', 'Console\AdminController@register');//管理员注册和编辑
Route::get('/console/admin_lists', 'Console\AdminController@admin_lists');//获取管理员列表(含搜索）
Route::get('/console/admin_details', 'Console\AdminController@admin_details');//获取管理员详情
Route::post('/console/change_status', 'Console\AdminController@change_status');//修改管理员状态
Route::post('/console/del_admin', 'Console\AdminController@del_admin');//删除管理员
Route::post('/console/login_out', 'Console\AdminController@login_out');//管理员退出
Route::get('/console/roles', 'Console\AdminController@roles');//角色下拉菜单（添加编辑管理员信息时使用)

//角色管理
Route::post('/console/act_role', 'Console\RoleController@act_role');//添加编辑角色
Route::get('/console/role_lists', 'Console\RoleController@role_lists');//获取角色列表
Route::post('/console/del_role', 'Console\RoleController@del_role');//删除角色
Route::post('/console/act_role_purview', 'Console\RoleController@act_role_purview');//分配权限
Route::get('/console/purviews', 'Console\RoleController@purviews');//权限下拉菜单

//角色权限管理
Route::post('/console/act_purview', 'Console\PurviewController@act_purview');//添加编辑角色权限
Route::get('/console/purview_lists', 'Console\PurviewController@purview_lists');//角色权限列表
Route::post('/console/del_purview', 'Console\PurviewController@del_purview');//删除角色权限
Route::post('/console/act_purview_menu', 'Console\PurviewController@act_purview_menu');//删除角色权限
Route::post('/console/memus', 'Console\PurviewController@memus');//可用菜单下拉

//菜单管理
Route::post('/console/act_menu', 'Console\MenuController@act_menu');//添加编辑菜单
Route::get('/console/menu_lists', 'Console\MenuController@menu_lists');//菜单列表（全部）
Route::post('/console/del_menu', 'Console\MenuController@del_menu');//删除菜单
Route::post('/console/change_menu', 'Console\MenuController@change_menu');//修改菜单状态
Route::post('/console/act_menu_auth', 'Console\MenuController@act_menu_auth');//添加修改菜单api权限
Route::post('/console/menu_auth_lists', 'Console\MenuController@menu_auth_lists');//api权限列表
Route::post('/console/del_menu_auth', 'Console\MenuController@del_menu_auth');//删除菜单权限

//区域选择
Route::get('/areas/provinces', 'Console\AreasController@allProvinces');
Route::get('/areas/cities', 'Console\AreasController@allCities');
Route::get('/areas/all', 'Console\AreasController@allAreas');
Route::get('/areas/nest', 'Console\AreasController@nest');
Route::get('/areas/child', 'Console\AreasController@nestFromChild');



